package com.meituan.dao;

import com.meituan.pojo.entity.Stores;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

@Mapper
public interface StoresDao extends JpaRepository<Stores, Integer> {
    @Query(value = "select s.* from fuye f,fuye_stores fs,stores s where f.fid=fs.fid and fs.sid=s.sid and f.zid=?1 ",nativeQuery = true)
    List<Stores> findByZid(Integer zid);

    List<Stores> findByState(Integer state);
    @Query(value = "select s.* from fuye_stores fs,stores s where  fs.sid=s.sid and fs.fid=?1 ",nativeQuery = true)
    List<Stores> findByFid(Integer fid);
}
